package main

import (
	"fmt"
	"fox/src/lexer"
	"fox/src/parser"
)

func main() {

	str := `
	let age=12;
	
	`
	lex := lexer.NewLexer(str)
	/* //循环打印token
	for tok := lex.NextToken(); tok.Type != lexer.EOF; tok = lex.NextToken() {
		fmt.Printf("%+v\n", tok)
	} */

	p := parser.New(lex)
	program := p.ParseProgram()

	// fmt.Printf("%+v\n", p)
	formatted := fmt.Sprintf("%+v", p)
	fmt.Println(formatted)
	fmt.Println("\n")
	fmt.Println("program:", program.StringTree())
}
